package com.supinfo.food.services;

import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

import com.supinfo.food.dao.DaoFactory;
import com.supinfo.food.dao.MenuDao;
import com.supinfo.food.entities.Menu;

/**
 * Customer service
 * @author Keitaro
 */
@WebService(name="Menu", serviceName="Menu")
public class MenuService {

	private MenuDao dao = DaoFactory.getMenuDao();
	
	@WebMethod(operationName="addMenu")
	public Menu	addMenu(@WebParam(name="menu") Menu menu) {
		return dao.addMenu(menu);
	}

	@WebMethod(operationName="updateMenu")
	public Menu	updateMenu(@WebParam(name="menu") Menu menu) {
		return dao.updateMenu(menu);
	}

	@WebMethod(operationName="getAllMenu")
	public List<Menu> getAllMenu() {
		return dao.getAllMenus();
	}

	@WebMethod(operationName="getMenuById")
	public Menu getMenuById(@WebParam(name="id") Long id) {
		return dao.findMenu(id);
	}

	@WebMethod(operationName="removeMenu")
	public void removeMenu(@WebParam(name="menu") Menu menu) {
		dao.removeMenu(menu);
	}
	
}
